<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAdminUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admin_users', function (Blueprint $table) {
            $table->id();
            $table->string('username', 32)->comment('用户名')->unique();
            $table->string('phone')->nullable()->comment('手机号')->unique();
            $table->string('email')->nullable()->comment('邮箱')->unique();
            $table->string('password', 60)->comment('密码');
            $table->string('avatar')->nullable()->comment('头像');
            $table->string('status')->default(\App\Models\AdminUser::STATUS_NORMAL)->comment('用户状态');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('admin_users');
    }
}
